package com.qijian.tool.domain.vo;

import lombok.Data;

import java.math.BigDecimal;
import java.math.RoundingMode;

@Data
public class SalesReportVo {
    private BigDecimal total;
    private BigDecimal deliver;
    private BigDecimal stock;
    private BigDecimal surplus;

    public BigDecimal getDeliver() {
        return deliver.setScale(2, RoundingMode.HALF_UP);
    }

    public BigDecimal getSurplus() {
        return total.subtract(deliver).subtract(stock);
    }
}
